Scheduling Server Automation Scripts

In Innovation Studio, engineers can plan an automation script to run periodically by using the Scheduling feature.

A scheduled job can be set up to run at a fixed interval of time starting with Start Time (Pool Time) or using a Cron Expression.

To schedule a server automation script, follow tese steps

STEP 1. Add schedule job

To add a scheduled job, follow these steps:

  1. From the menu, click Business Automation > Scheduled Jobs. The Scheduled Jobs List page appears.
  2. At the top-right corner of the page, click the Insert icon. The Add Scheduled Job page appears.
  3. Fill in the mandatory fields (marked with a red asterix).
  4. (Optionally) If you want to set up specific days when the job will not execute, in the Calendar (exclude days) field , provide the code to do so. The types of calendar exclusion can be: ANNUAL (dd.MM), MONTHLY (dd), WEEKLY (days in week: Monday, Tuesday, .etc), HOLIDAY (dd.MM.yyyy).
  5. Tick the Enabled checkbox to enable the scheduled job, otherwise it will not run.
  6. At the top-right corner of the page, click the Save and reload icon. The record is saved in the system and the Edit Scheduled Job page appears.

Now you can add schedule services.

STEP 2. Add schedule services

  1. In the Edit Scheduled Job page, scroll-down to the Schedule Services section and click the Insert button. The Add Schedule Service page appears.
  2. In the Name field, provide a name for the service.
  3. Click the down arrow next to the Workflow field. A pop-up appears listing all existing server automation scripts.
  4. Select the server automation script you want to schedule by double-clicking on it.
  5. At the top-right corner of the page, click the Save and close icon to save the record. Add as schedule services as automation scripts you want to schedule for execution.

If you have more than one scheduled service in the Schedule Services list, you can set their execution order.

STEP 3. Set the execution order

If you have several automation scripts scheduled and need them to be run in a specific order, drag and drop records in the Schedule Services section in their execution order (whereas the first record in the section is the first one to be executed).

If you choose that one of the service is mandatory and it fails, all the following services (scripts) will no longer execute. Also, if you will choose to run script async (when adding /editing a schedule service by selecting the Async checkbox), the order of services will be disregarded and all automation scripts will run in parallel.

Copy

[{
        name:"calAnual",
        type:"ANNUAL",
        excludeDays:["03.11","17.01"]
      },
    {
        name:"calMonthly",
        type:"MONTHLY",
        excludeDays:["25","10"]
    },
    {
        name:"calWeekly",
        type:"WEEKLY",
        excludeDays:["Saturday","Sunday"]
    },
    {
        name:"calHoliday",
        type:"HOLIDAY",
        excludeDays:["25.12.2018","01.01.2019"]
    }
]        
NOTE In order for the cron jobs to trigger the automation script execution, the Job Server should be installed on deployment.

Job Server is aware of jobs changes (time, cron expression, reorder of services).

For all failed jobs, a Run now button is displayed which allows running the jobs again. The job data model has been updated to include a parent job id. When running a failed job (clicking the Run now button), a copy of the job is made having the parentJobId = original Job and it will be scheduled to run only once in 1 minute.